package main

import (
	"SkillTextJD2/contreller"
	"github.com/gin-contrib/cors"
	"github.com/gin-gonic/gin"
)

func main() {

	//Util.DB().Table("city_arttractions").CreateTable(&model.City_Attractions{})
	//Util.DB().Table("users").CreateTable(&model.User{})
	//Util.DB().Table("attractions").CreateTable(&model.Attractions{})
	//Util.DB().Table("Tour_group").CreateTable(&model.Tour{})
	//Util.DB().Table("Information").CreateTable(&model.Information{})
	//Util.DB().Table("payment").CreateTable(&model.But{})

	res := gin.Default()
	res.Use(cors.Default())
	res.LoadHTMLGlob("template/*")
	res.Static("/static", "static")
	res.GET("/index", contreller.HandlerIndex)               //首页
	res.GET("/login", contreller.HandlerLogin)               //登录
	res.GET("/tologin", contreller.HandlerToLogin)           //去登录
	res.GET("/register", contreller.HandlerRegister)         //注册
	res.POST("/toregister", contreller.HandlerToRegister)    //去注册
	res.GET("/information", contreller.HandlerInformation)   //旅行信息
	res.GET("/information2", contreller.Handlerinformation2) //旅行信息
	res.GET("/buy", contreller.HandlerBuy)                   //订购
	res.GET("/payment", contreller.Handlerpayment)           //订购
	res.POST("/payment2", contreller.HandlerBut)             //订购
	res.GET("/scenery", contreller.HandlerScenery)           //景点风景欣赏
	res.GET("/WhereName", contreller.HandlerInquire)         //查询
	res.POST("/Inquire1", contreller.AttractionsInquire)
	res.POST("/Inquire2", contreller.Tour_group_purchasesHandler)
	res.POST("/Inquire4", contreller.City_AttractionsHandler)
	res.POST("/Inquire3", contreller.City_arttractions)
	res.GET("/changsha", contreller.HandlerChangsha)
	res.GET("/shanghai", contreller.HandlerShanghai)
	res.GET("/dali", contreller.HandlerDaLi)
	res.GET("/aomen", contreller.HandlerAoMen)
	res.GET("/weinisi", contreller.HandlerWeiNiSi)
	res.POST("/attraction", contreller.HandlerAttraction) //景点
	res.GET("/Gobuy", contreller.BuyPageHandler)
	res.Run(":8080")
}
